// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
import VueAxios from 'vue-axios'
import base from './assets/base'
import GlobalVariable from './assets/globalVariable'
import BaiduMap from 'vue-baidu-map';
import request from "../src/assets/request";
import store from "@/vuex/store"
import 'babel-polyfill';
// import Lodop from '@/utils/LodopFuncs';//打印控件
import quillEditor from 'vue-quill-editor';
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
import echarts from 'echarts';
import * as myApi from "@/components/api";
import UmyUi from 'umy-ui' //引入umy表格 替代element 解决数据过多表格卡顿
import 'umy-ui/lib/theme-chalk/index.css'; // 引入样式
import Contextmenu from "vue-contextmenujs" //右键功能引入
import '../node_modules/echarts/map/js/world.js' // 引入世界地图
// 表单重置
export function resetForm(refName) {
  if (this.$refs[refName]) {
    console.log(this.$refs[refName].resetFields)
    this.$refs[refName].resetFields();
  }
}
Vue.use(Contextmenu);

Vue.prototype.resetForm = resetForm
Vue.prototype.$myApi = myApi //接口文档
var mainUrl = 'http://121.40.246.215'
// Vue.use(Lodop)
Vue.use(BaiduMap, {
  ak: 'IKCGrDVtxdNXTGGePRdYLo45ZBUlKNTm'
});
Vue.use(UmyUi);
Vue.use(base);
Vue.use(ElementUI)
Vue.use(quillEditor)
Vue.config.productionTip = false
Vue.use(VueAxios, axios)
Vue.prototype.$echarts = echarts
// Vue.prototype.$http = axios;
Vue.prototype.apiRightCode = 0
Vue.prototype.url = "http://121.40.246.215/api/erp/util/currencyApi/uploadFile"
Vue.prototype.url2 = "http://121.40.246.215"
Vue.prototype.warehouseStockUpload = mainUrl + "/api/erp/warehouseStock/upload"
// Vue.prototype.uploadHeards = window.localStorage.userList ? {
//   userLoginToken: JSON.parse(window.localStorage.userList).loginToken
// } : ''
Vue.prototype.request = request
Vue.prototype.shopList = '123'
Vue.prototype.Global = GlobalVariable
//时间转换
//案例 new Date().Format("yyyy-MM-dd hh:mm:ss")
Date.prototype.Format = function (fmt) {
  // author: meizz
  var o = {
    'M+': this.getMonth() + 1, // 月份
    'd+': this.getDate(), // 日
    'h+': this.getHours(), // 小时
    'm+': this.getMinutes(), // 分
    's+': this.getSeconds(), // 秒
    'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
    S: this.getMilliseconds(), // 毫秒
  };
  if (/(y+)/.test(fmt))
    fmt = fmt.replace(
      RegExp.$1,
      (this.getFullYear() + '').substr(4 - RegExp.$1.length)
    );
  for (var k in o)
    if (new RegExp('(' + k + ')').test(fmt))
      fmt = fmt.replace(
        RegExp.$1,
        RegExp.$1.length == 1 ?
        o[k] :
        ('00' + o[k]).substr(('' + o[k]).length)
      );
  return fmt;
};
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  axios,
  render: h => h(App),
  components: {
    App
  },
  template: '<App/>'
})
